<ui:composition template="template.xhtml"
				xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui">
<link rel="stylesheet" href="../css/style.css" type="text/css"/>
<ui:define name="body">
<table>
	<tr>
		<td class="texto3"  style="height:400px;width:900px;background-color: #F5F5DC" align="center">
			<p:messages id="msgs" showDetail="false"/>
			<h:form >  
				<p:wizard widgetVar="wiz" flowListener="#{alunoBean.onFlowProcess}" backLabel="#{msg.button_anterior}" nextLabel="#{msg.button_proximo}">  			  
			         <p:tab id="personal" title="#{msg.label_pessoal}" >  			   
			             <p:panel header="#{msg.label_dados_pessoais}">  
			               
			                 <h:messages errorClass="error"/>  
			                   
			                 <h:panelGrid columns="2" columnClasses="label, value" styleClass="grid">  
			                     <h:outputText value="#{msg.label_nome_completo}(*):" />  
			                     <p:inputText required="true" requiredMessage="#{msg.erro_nome_necessario}" size="55" label="nome" value="#{alunoBean.aluno.nomeCompleto}" />  
			                       
			                     <h:outputText value="#{msg.label_nome_pai}:" />  
			                     <p:inputText label="pai" size="55" value="#{alunoBean.aluno.nomePai}" />  
			                     
			                     <h:outputText value="#{msg.label_nome_mae}(*):" />  
			                     <p:inputText required="true" requiredMessage="#{msg.erro_nome_mae_necessario}"  size="55" label="mae" value="#{alunoBean.aluno.nomeMae}" />  
			                       
			                     <h:outputText value="#{msg.label_idade}(*): " />  
			                     <p:inputText required="true" requiredMessage="#{msg.erro_idade_necessario}" size="5" value="#{alunoBean.aluno.idade}" /> 
			                     
			                     <h:outputText value="#{msg.label_data_nascimento}(*): " />  
			                     <p:calendar required="true" requiredMessage="#{msg.erro_nascimento_necessario}" pattern="dd/MM/yyyy" navigator="true" value="#{alunoBean.aluno.dataNascimento}" />
			                     
			                     <h:outputText value="#{msg.label_sexo}(*): " />  
			                     <h:selectOneMenu value="#{alunoBean.selectedSexo}" immediate="true">  
			                    	 <f:selectItem itemLabel=" ------- " itemValue="" />  
				                     <f:selectItem itemLabel="Masculino" itemValue="masculino" />  
			    	                 <f:selectItem itemLabel="Feminino" itemValue="feminino" />  
			        	             <f:selectItem itemLabel="Outro" itemValue="outro" />  
			                 	 </h:selectOneMenu>   
			                       
			                     <h:outputText value="#{msg.label_endereco}(*):" />  
			                     <p:inputText required="true" requiredMessage="#{msg.erro_endereco_necessario}" size="60" label="endereco" value="#{alunoBean.aluno.endereco}" />  
			                     
			                     <h:outputText value="#{msg.label_telefone_residencial}:" />  
			                     <p:inputMask value="#{alunoBean.aluno.telefone}" size="20" mask="(99) 9999-9999"/>
			                     
			                     <h:outputText value="#{msg.label_celular}:" />  
			                     <p:inputMask value="#{alunoBean.aluno.celular}" size="20" mask="(99) 9999-9999"/> 
			                       
			                 </h:panelGrid>  
			             </p:panel>  
			         </p:tab> 
			         <p:tab id="photo" title="#{msg.label_foto}" >  			   
			             <p:panel header="#{msg.label_fotografia}">  
			               
			                 <h:messages errorClass="error"/>  
			                   
			                 <h:panelGrid columns="1" styleClass="grid">  
			                 	<p:graphicImage id="imagem"  value="#{alunoBean.arquivo}" cache="false"/>
			                 	<p:fileUpload  sizeLimit="204800" auto="true" widgetVar="uploader" label="Procurar..."  fileUploadListener="#{alunoBean.handleFileUpload}"
 allowTypes="*.jpeg;*.jpg;*.png;*.gif;" description="Images" update="imagem" multiple="false" customUI="true"/>
  							 </h:panelGrid>  
			             </p:panel>  
			         </p:tab> 
					 <p:tab id="address" title="#{msg.label_escolaridade}" >  
			             <p:panel header="#{msg.label_dados_escolares}"> 
			             	<h:messages errorClass="error"/>  
					             <h:panelGrid columns="2" columnClasses="label, value">  
			                     <h:outputText value="#{msg.label_escolaridade}: " />  
			                     <h:selectOneMenu value="#{alunoBean.selectedEscolaridade}" immediate="true">  
			                     	<f:selectItems value="#{alunoBean.escolaridades}" />   
			                 	 </h:selectOneMenu>  
			                 	 
			                 	 <h:outputText value="#{msg.label_escola}:" />  
			                     <p:inputText required="true" requiredMessage="#{msg.erro_escola_necessario}" size="50" label="endereco" value="#{alunoBean.aluno.escola}" />  
			                     
			                     <h:outputText value="#{msg.label_ciclo}: " immediate="true"/>  
			                     <h:selectOneMenu value="#{alunoBean.selectedCiclo}">  
				                     <f:selectItems value="#{alunoBean.ciclos}" />
			                 	 </h:selectOneMenu> 
			                 </h:panelGrid>  
			             </p:panel>  
			         </p:tab>                 
			         <p:tab id="confirm" title="#{msg.label_confirmacao}">  
			             <p:panel header="#{msg.label_confirmacao_dados}">			               
			                 <p:growl id="growl" sticky="true" showDetail="false" showSummary="false"/>  
			               
			                 <h:panelGrid id="confirmation" columns="4" cellspacing="5" cellpadding="5">  
			                     <h:outputText value="#{msg.label_nome_completo}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.aluno.nomeCompleto}" />
			                     <h:outputText value="#{msg.label_nome_pai}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.aluno.nomePai}" />
			                     <h:outputText value="#{msg.label_nome_mae}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.aluno.nomeMae}" />
			                     <h:outputText value="#{msg.label_idade}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.aluno.idade}" />
			                     <h:outputText value="#{msg.label_data_nascimento}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.aluno.dataNascimento}" >
			                     	 <f:convertDateTime pattern="dd/MMM/yyyy" />
			                     </h:outputText>
			                     <h:outputText value="#{msg.label_sexo}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.selectedSexo}" />  
			                     <h:outputText value="#{msg.label_endereco}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.aluno.endereco}" />
			                     <h:outputText value="#{msg.label_telefone_residencial}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.aluno.telefone}" />
			                     <h:outputText value="#{msg.label_celular}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.aluno.celular}" />
			                     <h:outputText value="#{msg.label_escolaridade}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.escolaridade.sigla}" />  
			                     <h:outputText value="#{msg.label_escola}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.aluno.escola}" />
			                     <h:outputText value="#{msg.label_ciclo}: " />  
			                     <h:outputText styleClass="outputLabel" value="#{alunoBean.ciclo.sigla}" /> 			                                         
			                 </h:panelGrid>                     
			                 <p:commandButton value="#{msg.button_salvar}" update="growl,msgs"  actionListener="#{alunoBean.cadastrarAluno}"/>
			                 <p:commandButton value="#{msg.button_cancelar}" action="#{alunoBean.cancelar}" ajax="false"/>  
			               
			             </p:panel>  
			         </p:tab>            
			     </p:wizard>  
			       
			     <p:ajaxStatus>  
			         <f:facet name="start">  
			             <h:graphicImage value="../images/barra.gif" />  
			         </f:facet>  
			           
			         <f:facet name="complete">  
			             <h:outputText value="" />  
			         </f:facet>  
			     </p:ajaxStatus>  
			                               
			 </h:form>
		</td>
	</tr>
</table>
</ui:define>
</ui:composition>